﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site1.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%int areacode = this.Context.GetParameter("areaCode").ToInt32(0);// Request["areaCode"].ToInt32(0);
      int positiontype = this.Context.GetParameter("positionType").ToInt32(0);// Request["positionType"].ToInt32(0);
        if (areacode > 0)
      { %>
      重庆<%:((AreaCode)areacode).Mapping()%>兼职 <%if (positiontype <= 0)
                                                                      { %>-<%} %>
    <%}
        if (positiontype > 0)
      {%>
      <%if (areacode <= 0)
        { %>重庆<%} %><%:((PositionType)positiontype).Mapping()%> -
    <%} %>
     重庆大学生兼职网
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <link href="/content/css/main.css" rel="stylesheet" type="text/css" />
    <link href="/content/css/joblist.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="/scripts/slider.js"></script>
    <script type="text/javascript" src="/Scripts/library.js" charset="GB2312"></script>
    <script type="text/javascript" src="/Scripts/plug.js" charset="GB2312"></script>
    <script type="text/javascript">
        var qs = { area: '<%:this.Context.GetParameter("areaCode").ToInt32(0) %>', type: '<%:this.Context.GetParameter("positionType").ToInt32(0) %>' };
        function setqs(sender, value, type) {
            key = $(sender).text();
            //type 0:设置区域 1：职位类型 
            if (type == 0) {
                $('input[name="page"]').val(0);
                $('input[name="areaCode"]').val(value);
                qs.area = value;
            }
            else {
                $('input[name="page"]').val(0);
                $('input[name="positionType"]').val(value);
                qs.type = value;
            }
            displaySelected();
            $(sender).parent().parent().children('div').each(function () {
                $(this).children('a').removeClass('b');
            });
            $(sender).addClass('b');
        }

        function ChangeQtValue(sender) {
            $('input[name="qt"]').val($(sender).val());
        }
        function displaySelected() {
            $('#selectedlist').html('');
            if (qs.area != '0' && qs.area != '') {
                $('#selectedlist').append(
                            $('<div class="selecteditem" title="点击删除"><a href="javascript:;" onclick="cancelSelected(this,0)">' +
                                data.GetDataSource('workarea')[qs.area].name + '</a></div>'));
            }
            if (qs.type != '0' && qs.type != '') {
                $('#selectedlist').append(
                            $('<div class="selecteditem" title="点击删除"><a href="javascript:;" onclick="cancelSelected(this,1)">' +
                                data.GetDataSource('positionType')[qs.type].name + '</a></div>'));
            }
        }
        function cancelSelected(sender, type) {
            //type 0:设置区域 1：职位类型
            if (type == 0) {
                qs.area = '';
                $('#areacontainer').children('div').eq(0).children('a').trigger('click');
                $(sender).parent().remove();
            }
            else {
                qs.type = '';
                $('#ptcontainer').children('div').eq(0).children('a').trigger('click');
                $(sender).parent().remove();
            }
        }
        function OnPost() {
            if (event != undefined && (event.type == 'click' || event.type == 'change')) {
                $('#btnSearch').trigger('click');
            }
        }
        function setpage(page) {
            $('input[name="page"]').val(page);
        }
        function dosearch(id) {
            $('#' + id).trigger('click');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content">
        <div class="contentline">
            <div style="width: 100%; height: 15px; overflow: hidden">
            </div>
            <div class="left">
                <a href="/">
                    <img alt="重庆大学生兼职网" src="/content/images/logo2.png" /></a></div>
            <div class="left">
                <div class="main-nav-top">
                    <a href="/">重庆大学生兼职网</a> >
                    <%if (String.IsNullOrEmpty(Request["qt"]))
                      { %>
                    <a href="/home/positionlist">整站搜索</a>
                    <%}
                      else if (Request["qt"] == "1")
                      {%>
                    <a href="/home/PositionList_qt=1">最新兼职</a>
                    <%}
                      else if (Request["qt"] == "2")
                      {%>
                    <a href="/home/PositionList_qt=2">长期招聘</a>
                    <%} %>
                </div>
            </div>
            <div class="right" style="margin-top: 20px; padding-right: 2px;">
                <%if (HttpContext.Current.User.Identity.IsAuthenticated)
                  {
                      if (new UserService(HttpContext.Current.User.Identity.Name).GetUser().Role == MemberStatus.Firm)
                      { %>
                <a href="/CompanyCenter/Recruiting" target="_blank">
                    <img alt="发布兼职" src="/content/images/button-jzfb.png" /></a>
                    <%}
                  else
                  {%>
                <a href="/home/roleselect" target="_blank">
                    <img alt="发布兼职" src="/content/images/button-jzfb.png" /></a>
                <%} %>
                <%}
                  else
                  {%>
                <a href="/home/roleselect" target="_blank">
                    <img alt="发布兼职" src="/content/images/button-jzfb.png" /></a>
                <%} %>
            </div>
            <div style="width: 100%; height: 10px; overflow: hidden">
            </div>
        </div>
        <div class="search">
            <form action="/home/positionlist" method="post">
            <input type="hidden" name="areaCode" value="<%:Request["areaCode"] %>" />
            <input type="hidden" name="positionType" value="<%:Request["positionType"] %>" />
            <input type="hidden" name="page" value="<%:Request["page"] %>" />
            <input type="hidden" name="qt" value="<%:Request["qt"] %>" />
            <input type="hidden" name="qj" value="<%:Request["qj"] %>" />
            <input type="hidden" name="ag" value="<%:Request["ag"] %>" />
            <div class="search-box">
                <div class="left">
                    <select class="typeselect" onchange="ChangeQtValue(this);OnPost();">
                        <option <%if(String.IsNullOrEmpty(Request["qt"])){ %> selected="selected" <%} %>
                            value="" style="color: Gray">整站搜索</option>
                        <option <%if(Request["qt"] == "2"){ %> selected="selected" <%} %> value="2" style="color: Gray">
                            长期招聘</option>
                        <option <%if(Request["qt"] == "1"){ %> selected="selected" <%} %> value="1" style="color: Gray">
                            最新兼职</option>
                    </select></div>
                <div class="left">
                    <input type="text" name="qs" class="search-ipt" value="<%:Request["qs"] %>" /></div>
                <div class="left" style="margin-left: 10px; margin-top: 1px;">
                    <input id="btnSearch" type="image" src="/content/images/buttom-search.png" />
                </div>
            </div>
            </form>
            <div class="search-condition">
                <div class="contentline">
                    <div class="left">
                        <div class="left">
                            区域:</div>
                    </div>
                    <div id="areacontainer" class="left" style="width: 860px">
                        <script type="text/javascript">
                            //                            var crtarea = '<%:Request.Form["areaCode"] %>';
                            //                            crtarea = (crtarea == '-1' || crtarea == '') ? 0 : crtarea;
                            var areadatasource = data.GetDataSource('workarea');
                            for (var i = 0, len = areadatasource.length; i < len; i++) {
                                document.write('<div class="areaitem">');
                                document.write('<a href="javascript:;" id="wa' + areadatasource[i].value + '" onclick="setqs(this,' + areadatasource[i].value + ',0);OnPost();" ');
                                //                                if(areadatasource[i].value == (qs.area ==''?0:parseInt(qs.area,10)))
                                //                                {
                                //                                    document.write(' class="b"');
                                //                                }
                                document.write('>');
                                document.write(areadatasource[i].name);
                                document.write('</a>');
                                document.write('</div>');
                            }
                            $(function () {
                                $('#areacontainer').children('div').eq(qs.area == '' ? 0 : parseInt(qs.area, 10)).children('a').trigger('click');
                            });
                        </script>
                    </div>
                </div>
                <div class="hspace10">
                </div>
                <div class="hspace10">
                </div>
                <div class="contentline">
                    <div class="left">
                        <div class="left">
                            职位:</div>
                    </div>
                    <div id="ptcontainer" class="left" style="width: 860px">
                        <script type="text/javascript">
                            var ptdatasource = data.GetDataSource('positiontype');
                            for (var i = 0, len = ptdatasource.length; i < len; i++) {
                                document.write('<div class="areaitem">');
                                document.write('<a href="javascript:;" id="pt' + ptdatasource[i].value + '" onclick="setqs(this,' + ptdatasource[i].value + ',1);OnPost();" ');
                                document.write('>');
                                document.write(ptdatasource[i].name);
                                document.write('</a>');
                                document.write('</div>');
                            }
                            $(function () {
                                $('#ptcontainer').children('div').eq(qs.type == '' ? 0 : parseInt(qs.type, 10)).children('a').trigger('click');
                            });
                        </script>
                    </div>
                </div>
                <div class="hspace10">
                </div>
                <div class="hspace10">
                </div>
            </div>
            <div class="search-bottom">
                <div class="left">
                    已选条件:</div>
                <div id="selectedlist" class="left" style="width: 860px">
                </div>
            </div>
        </div>
        <div style="width:975px; text-align:center; padding-bottom:10px;">
            <a href="http://www.letao.com/lianmeng/manage/linkImage.aspx?wh=960&ht=60&wid=114&sid=hugo12345" target="_blank"><img src="http://www.letao.com/lianmeng/manage/linkImage.aspx?wh=960&ht=60&wid=114" alt="乐淘网上商城"/></a>
        </div>
        <div class="joblist">
            <div class="joblist-left">
                <div class="joblist-list">
                    <div class="joblist-header">
                        <div class="joblist-line1">
                            <span style="margin-left: 15px;">兼职</span></div>
                        <div class="joblist-line5">
                            职位类型
                        </div>
                        <div class="joblist-line3">
                            时间</div>
                        <div class="joblist-line2">
                            区域</div>
                        <div class="joblist-line4">
                            招聘企业
                        </div>
                    </div>
                    <%var list = ViewData["data"] as ItemListBox<ueEngine.Biz.Core.ExServer.WorkPool.WorkHandle.FullSearch.PositionCell>;
                      foreach (var item in list.Data)
                      { %>
                    <div class="joblist-item">
                        <div class="joblist-line1">
                        <%if(item.RecruitSheetSubject == 1)
                          { %>
                            <div class="joblist-item-jian"></div>
                            <%}
                              else
                              { %>
                            <div class="joblist-item-pin"></div>
                              <%} %>
                            <div class="joblist-item-title">
                                <a href="<%:item.Url %>" title="<%=item.Title %>" target="_blank">
                                  <%=item.Title.PieceOfString(0, 16)%></a></div>
                            <%if (item.Priority == 1)
                              { %>
                            <div title="急聘" class="joblist-item-jipin"></div>
                            <%} %>
                            <%switch ((CertificationLevel)item.CertificationLevel)
                              {
                                  default:
                                  case CertificationLevel.Normal:
                                      break;
                                  case CertificationLevel.Contract:%>
                                  <a target="_blank" href="/home/companylevel"><div title="兼职来至认证企业" class="joblist-item-renzheng"></div></a>
                            <%        break;
                                  case CertificationLevel.Authority:%>
                                  <a target="_blank" href="/home/companylevel"><div title="兼职来至合作企业" class="joblist-item-hezhuo"></div></a>
                            <%        break;
                                  } %>
                        </div>
                        <div class="joblist-line5">
                            <a href="<%:item.Url %>" target="_blank">
                                <%:((PositionType)item.PositionType).Mapping().PieceOfString(0,8) %></a>                          
                        </div>
                        <div class="joblist-line3">
                            <%
                              var span = DateTime.Now.Subtract(item.PublishDate);
                              if (span.TotalMinutes <= 30)
                              { %>
                            <%:(span.TotalMinutes) < 1 ? "1" : ((int)span.TotalMinutes).ToString()%>分钟前
                            <%}
                              else if (DateTime.Now.DayOfYear - item.PublishDate.DayOfYear == 0)
                                  { %>
                            <%:"今天"%>
                            <%}
                                  else
                                  {%>
                            <%:item.PublishDate.ToString("M-d") %>
                            <%} %></div>
                        <div class="joblist-line2">
                            <a onclick="dosearch('wa<%:(int)item.WorkArea.DeMapping() %>')" href="javascript:;">
                                <%:item.WorkArea %></a>
                        </div>
                        <div class="joblist-line4">
                            <span title="<%:item.CompanyName %>"><%:item.CompanyName.PieceOfString(0,15) %></span>
                        </div>
                    </div>
                    <%} %>   
                </div>
                <div class="joblist-pages">
                    <!--上一页-->
                    <%if (list.PrePage <= 0 && list.CurrentPage == 0)
                      {%>
                    <div class="joblist-pages-prev-gray">
                        <a href="javascript:;"></a>
                    </div>
                    <%}
                      else
                      { %>
                    <div class="joblist-pages-prev">
                        <a href="javascript:;" onclick="setpage(<%:list.PrePage %>);OnPost()"></a>
                    </div>
                    <%} %>
                    <%=list.PageItemSegment %>
                    <%if (list.NextPage <= 0 || list.NextPage >= list.TotlePage || list.CurrentPage == list.TotlePage-1)
                      { %>
                    <div class="joblist-pages-next-gray">
                        <a href="javascript:;"></a>
                    </div>
                    <%}
                      else
                      { %>
                    <div class="joblist-pages-next">
                        <a href="javascript:;" onclick="setpage(<%:list.NextPage %>);OnPost()"></a>
                    </div>
                    <%} %>
                </div>
            </div>
            <div class="joblist-right">
                <div class="rightad">
                    <a href="/content/html/default.html" target="_blank">
                        <img alt="曦雅舞蹈俱乐部" src="/content/images/sidead1.jpg" /></a>
                </div>
                <div class="rightad">
                    <a href="#">文字广告</a>
                </div>
                <div class="rightad">
                    <div class="rightad-title">
                        <a href="http://www.csaep.org" title="中华科教出版社-全球最大中文开源电子论文出版社" target="_blank">中华科教出版社</a></div>
                    <div>
                        硕士论文，毕业论文，学术期刊</div>
                    <a href="http://www.csaep.org" target="_blank">www.csaep.org</a>
                    <div class="hspace10">
                    </div>
                </div>
                <div class="rightad">
                    <div class="rightad-title">
                        <a href="http://www.cqyupo.com" target="_blank">重庆玉珀保温建材</a></div>
                    <div>
                        保温材料，外墙保温系统</div>
                    <a href="http://www.cqyupo.com" target="_blank">www.bayu.cc</a>
                    <div class="hspace10">
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
